package vues;

import java.awt.Dimension;
import java.text.SimpleDateFormat;
import java.util.Date;

import javax.swing.BorderFactory;
import javax.swing.JLabel;
import javax.swing.JPanel;

public class PanelDroite extends JPanel{


	private static final long serialVersionUID = 1L;
	private JLabel lblDebut = new JLabel("Début :");
	private JLabel lblTemps = new JLabel("Temps :");
	private JLabel lblFin = new JLabel("Fin :");
	private JLabel valeurDebut = new JLabel("");
	private JLabel valeurTemps = new JLabel("");
	private JLabel valeurFin = new JLabel("");
	private SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy hh:mm:ss");
	
	
	public PanelDroite(){
		this.lblDebut.setVisible(false);
		this.valeurDebut.setPreferredSize(new Dimension(220,20));
		this.lblTemps.setVisible(false);
		this.valeurTemps.setPreferredSize(new Dimension(220,20));
		this.lblFin.setVisible(false);
		this.valeurFin.setPreferredSize(new Dimension(220,20));
		this.setBorder(BorderFactory.createTitledBorder("Statistiques"));
		this.setPreferredSize(new Dimension(300,900));
		this.add(lblDebut);
		this.add(valeurDebut);
		this.add(lblTemps);
		this.add(valeurTemps);
		this.add(lblFin);
		this.add(valeurFin);
	}

	public String getValeurDebut() {
		return valeurDebut.getText();
	}

	public void setValeurDebut(String valeurDebut) {
		this.valeurDebut.setText(valeurDebut);
	}

	public JLabel getValeurTemps() {
		return valeurTemps;
	}

	public void setValeurTemps(String valeurTemps) {
		this.valeurTemps.setText(valeurTemps);
	}
	
	public void afficherStatEnCours(){
		this.lblDebut.setVisible(true);
		this.valeurDebut.setText(sdf.format(new Date()));
		this.lblTemps.setVisible(true);
	}
	
	public void afficherStatEnFin(){
		this.lblFin.setVisible(true);
		this.valeurFin.setText(sdf.format(new Date()));
	}

	public void setValeurFin(String valeurFin) {
		this.valeurFin.setText(valeurFin);
		
	}
}
